package com.center.biz.impl;

import com.center.api.model.SysSubject;
import com.center.api.remote.RemoteSysSubjectService;
import com.center.biz.dao.SysSubjectMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service(version = "1.0",interfaceClass = RemoteSysSubjectService.class)
public class RemoteSysSubjectServiceImpl implements RemoteSysSubjectService{

    @Autowired
    private SysSubjectMapper sysSubjectMapper;

    @Override
    public int save(SysSubject sysSubject) {
        return sysSubjectMapper.insertSelective(sysSubject);
    }

    @Override
    public int update(SysSubject sysSubject) {
        return sysSubjectMapper.updateByPrimaryKeySelective(sysSubject);
    }

    @Override
    public int delete(int id) {
        return sysSubjectMapper.deleteByPrimaryKey(id);
    }


    @Override
    public List<SysSubject> select(SysSubject sysSubject) {
       return sysSubjectMapper.select(sysSubject);
    }

    @Override
    public SysSubject getById(int id) {
        return sysSubjectMapper.selectByPrimaryKey(id);
    }
}
